package com.qyer.lxp.model.book.parameter;

import com.qyer.lxp.common.framework.adapter.DateAdapter;
import com.qyer.lxp.model.availability.parameter.AdditionalOption;
import com.qyer.lxp.model.availability.parameter.BookedSpecification;

import javax.xml.bind.annotation.*;
import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Created by jiangping on 16/7/1.
 */
@XmlRootElement(name = "book-item")
@XmlAccessorType(XmlAccessType.FIELD)
public class BookItem implements Serializable{
    private static final long serialVersionUID = -8955864402886530312L;

    /**
     * 订项的 email,收取确认邮件(必填)
     */
    private String email;

    /**
     * 分销商订项号 refer(必填)
     */
    @XmlElement(name = "distributor-order-item-refer")
    private String distributorOrderItemRefer;

    /**
     * 接的地点 code,如果产品是支持接客人的,需要填写地点的 code
     */
    @XmlElement(name = "pickup-code")
    private String pickupCode;

    /**
     * 如果产品支持客人自己填写地址,客人自己写的接的地点
     */
    @XmlElement(name = "pickup-point")
    private String pickupPoint;

    /**
     * 送的地点 code
     */
    @XmlElement(name = "dropoff-code")
    private String dropoffCode;

    /**
     * 客人自己写的送的地点
     */
    @XmlElement(name = "dropoff-point")
    private String dropoffPoint;

    /**
     * 旅行时间(必填)
     */
    @XmlElement(name = "travel-date")
    @XmlJavaTypeAdapter(value = DateAdapter.class)
    private Date travelDate;

    /**
     * 产品 code(必填)
     */
    @XmlElement(name = "product-code")
    private String productCode;

    /**
     * 销售项目 code(必填)
     */
    @XmlElement(name = "sale-code")
    private String saleCode;

    /**
     * 客人的特殊要求
     */
    @XmlElement(name = "special-requirements")
    private String specialRequirements;

    /**
     * 客人填写的预订问题的答案,根据预订限制接口中是否有预订问题来
     * 决定是否需要此节点
     */
    @XmlElementWrapper(name = "book-questions")
    @XmlElement(name = "book-question")
    private List<BookQuestion> bookQuestions;

    /**
     * 预订的规格信息(必填)
     */
    @XmlElementWrapper(name = "booked-specifications")
    @XmlElement(name = "booked-specification")
    private List<BookedSpecification> bookedSpecifications;

    /**
     * 领队人信息,根据预订限制接口来决定是否需要此节点
     */
    @XmlElement(name = "leader")
    private BookPersonInformation leader;

    /**
     * 旅客信息,根据预订限制接口来决定是否需要此节点
     */
    @XmlElementWrapper(name = "travellers")
    @XmlElement(name = "traveller")
    private List<BookPersonInformation> traveller;

    /**
     * 购买的附加选项
     */
    @XmlElementWrapper(name = "booked-options")
    @XmlElement(name = "additional-option")
    private List<AdditionalOption> additionalOption;

    /**
     * 配送根据预订限制接口来决定是否需要此节点
     */
    private Delivery delivery;

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getDistributorOrderItemRefer() {
        return distributorOrderItemRefer;
    }

    public void setDistributorOrderItemRefer(String distributorOrderItemRefer) {
        this.distributorOrderItemRefer = distributorOrderItemRefer;
    }

    public String getPickupCode() {
        return pickupCode;
    }

    public void setPickupCode(String pickupCode) {
        this.pickupCode = pickupCode;
    }

    public String getPickupPoint() {
        return pickupPoint;
    }

    public void setPickupPoint(String pickupPoint) {
        this.pickupPoint = pickupPoint;
    }

    public String getDropoffCode() {
        return dropoffCode;
    }

    public void setDropoffCode(String dropoffCode) {
        this.dropoffCode = dropoffCode;
    }

    public String getDropoffPoint() {
        return dropoffPoint;
    }

    public void setDropoffPoint(String dropoffPoint) {
        this.dropoffPoint = dropoffPoint;
    }

    public Date getTravelDate() {
        return travelDate;
    }

    public void setTravelDate(Date travelDate) {
        this.travelDate = travelDate;
    }

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public String getSaleCode() {
        return saleCode;
    }

    public void setSaleCode(String saleCode) {
        this.saleCode = saleCode;
    }

    public String getSpecialRequirements() {
        return specialRequirements;
    }

    public void setSpecialRequirements(String specialRequirements) {
        this.specialRequirements = specialRequirements;
    }

    public List<BookQuestion> getBookQuestions() {
        return bookQuestions;
    }

    public void setBookQuestions(List<BookQuestion> bookQuestions) {
        this.bookQuestions = bookQuestions;
    }

    public List<BookedSpecification> getBookedSpecifications() {
        return bookedSpecifications;
    }

    public void setBookedSpecifications(List<BookedSpecification> bookedSpecifications) {
        this.bookedSpecifications = bookedSpecifications;
    }

    public BookPersonInformation getLeader() {
        return leader;
    }

    public void setLeader(BookPersonInformation leader) {
        this.leader = leader;
    }

    public List<BookPersonInformation> getTraveller() {
        return traveller;
    }

    public void setTraveller(List<BookPersonInformation> traveller) {
        this.traveller = traveller;
    }

    public List<AdditionalOption> getAdditionalOption() {
        return additionalOption;
    }

    public void setAdditionalOption(List<AdditionalOption> additionalOption) {
        this.additionalOption = additionalOption;
    }

    public Delivery getDelivery() {
        return delivery;
    }

    public void setDelivery(Delivery delivery) {
        this.delivery = delivery;
    }

    @Override
    public String toString() {
        return "BookItem{" +
                "email='" + email + '\'' +
                ", distributorOrderItemRefer='" + distributorOrderItemRefer + '\'' +
                ", pickupCode='" + pickupCode + '\'' +
                ", pickupPoint='" + pickupPoint + '\'' +
                ", dropoffCode='" + dropoffCode + '\'' +
                ", dropoffPoint='" + dropoffPoint + '\'' +
                ", travelDate=" + travelDate +
                ", productCode='" + productCode + '\'' +
                ", saleCode='" + saleCode + '\'' +
                ", specialRequirements='" + specialRequirements + '\'' +
                ", bookQuestions=" + bookQuestions +
                ", bookedSpecifications=" + bookedSpecifications +
                ", leader=" + leader +
                ", traveller=" + traveller +
                ", additionalOption=" + additionalOption +
                ", delivery=" + delivery +
                '}';
    }
}
